function getInform() {
    $.ajax({
        type: "GET",
        url: "/my/user/userinfo",

        success: function (res) {
            console.log(res)
            console.log(res.data.user_pic)
            console.log(Boolean(res.data.user_pic))
            if (res.status === 0) {

                if (res.data.user_pic) {

                    $('.layui-nav-img').attr('src', res.data.user_pic).show()
                    $('.text-avatar').hide();

                } else {


                    let first = res.data.username.substring(0, 1).toUpperCase()
                    console.log(first)
                    $('.text-avatar').text(first).css('display', 'inline-block')

                }



                let username = res.data.nickname || res.data.username
                if (username) {
                    $('.str').text(username)


                }
            }

        }
    });
}
getInform()
$('.quiet').on('click', function (e) {
    e.preventDefault()
    console.log(window)
    layer.confirm('你确定要退出吗？', {
        icon: 3,
        title: "提示"
    }, function (index) {
        localStorage.removeItem('token')
        window.location.href = "./login.html"
        layer.close(index)

    })

})